#include "vsf.h"

// vsfav_entity_t
void vsfav_entity_add_input(struct vsfav_entity_t *entity, struct vsfav_entity_t *input)
{
	if (entity && input && (entity->input->valid_number < entity->input->number))
		entity->input->array[entity->input->valid_number++] = input;
}

// vsfav_dev_t
struct vsfav_entity_t *vsfav_get_entity_byid(struct vsfav_dev_t *dev, uint8_t id)
{
	for (uint8_t i = 0; i < dev->topology.num_of_entities; i++)
		if (dev->topology.entities[i]->id == id)
			return dev->topology.entities[i];
	return NULL;
}
